import 'dart:convert';

/// elderName : "马道长"
/// bedNo : "A108"
/// expenseItem : "冰刺激疗法"
/// executor : "王矫健"
/// nurseLevelId : 35
/// nurseLevel : "四级"
/// executeStatus : null
/// changeExecutorId : null
/// delayTime : null
/// customerElderId : 7667
/// serviceAreaId : null
/// bedId : 204
/// expenseItemId : 46
/// property : null
/// planStartTime : null
/// planEndTime : null
/// planExecuteBy : "[3366]"
/// fee : 20.00
/// executorId : 3366
/// status : 1
/// result : "[{\"value\": 123, \"rangeTo\": 140, \"subItem\": \"收缩压\", \"rangeFrom\": 90}, {\"value\": 98, \"rangeTo\": 90, \"subItem\": \"舒张压\", \"rangeFrom\": 60}]"
/// remark : "xxxxxxs"
/// finishTime : "2020-04-02 17:12:46"
/// deleteStatus : 0
/// branchId : 1612
/// cityId : null
/// tenantId : null
/// saasId : null
/// accCode : null
/// id : 16
/// createdBy : null
/// createdDate : "2020-04-07 20:36:29"
/// updatedBy : "3366"
/// updatedDate : null

class ServiceExecuteListData {
  ServiceExecuteListData({
    String? elderName,
    String? bedNo,
    String? expenseItem,
    String? executor,
    int? nurseLevelId,
    String? nurseLevel,
    dynamic executeStatus,
    dynamic changeExecutorId,
    dynamic delayTime,
    int? customerElderId,
    dynamic serviceAreaId,
    int? bedId,
    int? expenseItemId,
    dynamic property,
    dynamic planStartTime,
    dynamic planEndTime,
    String? planExecuteBy,
    num? fee,
    int? executorId,
    int? status,
    String? result,
    String? remark,
    String? finishTime,
    int? deleteStatus,
    int? branchId,
    dynamic cityId,
    dynamic tenantId,
    dynamic saasId,
    dynamic accCode,
    int? id,
    dynamic createdBy,
    String? createdDate,
    String? updatedBy,
    dynamic updatedDate,
    String? resultDesc,
    num? planTimeFlag,
    num? resultMode,
    this.itemDetail,
    this.itemImg
  }) {
    _elderName = elderName;
    _bedNo = bedNo;
    _expenseItem = expenseItem;
    _executor = executor;
    _nurseLevelId = nurseLevelId;
    _nurseLevel = nurseLevel;
    _executeStatus = executeStatus;
    _changeExecutorId = changeExecutorId;
    _delayTime = delayTime;
    _customerElderId = customerElderId;
    _serviceAreaId = serviceAreaId;
    _bedId = bedId;
    _expenseItemId = expenseItemId;
    _property = property;
    _planStartTime = planStartTime;
    _planEndTime = planEndTime;
    _planExecuteBy = planExecuteBy;
    _fee = fee;
    _executorId = executorId;
    _status = status;
    _result = result;
    _remark = remark;
    _finishTime = finishTime;
    _deleteStatus = deleteStatus;
    _branchId = branchId;
    _cityId = cityId;
    _tenantId = tenantId;
    _saasId = saasId;
    _accCode = accCode;
    _id = id;
    _createdBy = createdBy;
    _createdDate = createdDate;
    _updatedBy = updatedBy;
    _updatedDate = updatedDate;
    _resultMode = resultMode;
  }

  ServiceExecuteListData.fromJson(dynamic json) {
    _elderName = json['elderName'];
    _bedNo = json['bedNo'];
    _expenseItem = json['expenseItem'];
    _executor = json['executor'];
    _nurseLevelId = json['nurseLevelId'];
    _nurseLevel = json['nurseLevel'];
    _executeStatus = json['executeStatus'];
    _changeExecutorId = json['changeExecutorId'];
    _delayTime = json['delayTime'];
    _customerElderId = json['customerElderId'];
    _serviceAreaId = json['serviceAreaId'];
    _bedId = json['bedId'];
    _expenseItemId = json['expenseItemId'];
    _property = json['property'];
    _planStartTime = json['planStartTime'];
    _planEndTime = json['planEndTime'];
    _planExecuteBy = json['planExecuteBy'];
    _fee = json['fee'];
    _executorId = json['executorId'];
    _status = json['status'];
    _result = json['result'];
    _remark = json['remark'];
    _finishTime = json['finishTime'];
    _deleteStatus = json['deleteStatus'];
    _branchId = json['branchId'];
    _cityId = json['cityId'];
    _tenantId = json['tenantId'];
    _saasId = json['saasId'];
    _accCode = json['accCode'];
    _id = json['id'];
    _createdBy = json['createdBy'];
    _createdDate = json['createdDate'];
    _updatedBy = json['updatedBy'];
    _updatedDate = json['updatedDate'];
    _resultDesc = json['resultDesc'];
    _planTimeFlag = json['planTimeFlag'];
    expenseTypeName = json['expenseTypeName'];
    _resultMode = json['resultMode'];
    audioId = json['audioId'];
    photoIds = json['photoIds'];
    itemDetail = json['itemDetail'];
    itemImg = json['itemImg'];
  }

  String? _elderName;
  String? _bedNo;
  String? _expenseItem;
  String? expenseTypeName;
  String? _executor;
  int? _nurseLevelId;
  String? _nurseLevel;
  dynamic _executeStatus;
  dynamic _changeExecutorId;
  dynamic _delayTime;
  int? _customerElderId;
  dynamic _serviceAreaId;
  int? _bedId;
  int? _expenseItemId;
  dynamic _property;
  String? _planStartTime;
  String? _planEndTime;
  String? _planExecuteBy;
  num? _fee;
  int? _executorId;
  int? _status;
  String? _result;
  String? _remark;
  String? _finishTime;
  int? _deleteStatus;
  int? _branchId;
  dynamic _cityId;
  dynamic _tenantId;
  dynamic _saasId;
  dynamic _accCode;
  int? _id;
  dynamic _createdBy;
  String? _createdDate;
  String? _updatedBy;
  dynamic _updatedDate;
  String? _resultDesc;
  num? _planTimeFlag;
  num? _resultMode;
  String? itemDetail;
  dynamic itemImg;

  String? get elderName => _elderName;

  String? get bedNo => _bedNo;

  String? get expenseItem => _expenseItem;

  String? get executor => _executor;

  int? get nurseLevelId => _nurseLevelId;

  String? get nurseLevel => _nurseLevel;

  dynamic get executeStatus => _executeStatus;

  dynamic get changeExecutorId => _changeExecutorId;

  dynamic get delayTime => _delayTime;

  int? get customerElderId => _customerElderId;

  dynamic get serviceAreaId => _serviceAreaId;

  int? get bedId => _bedId;

  int? get expenseItemId => _expenseItemId;

  dynamic get property => _property;

  String? get planStartTime => _planStartTime;

  String? get planEndTime => _planEndTime;

  String? get planExecuteBy => _planExecuteBy;

  num? get fee => _fee;

  int? get executorId => _executorId;

  int? get status => _status;

  String? get result => _result;

  String? get remark => _remark;

  String? get finishTime => _finishTime;

  int? get deleteStatus => _deleteStatus;

  int? get branchId => _branchId;

  dynamic get cityId => _cityId;

  dynamic get tenantId => _tenantId;

  dynamic get saasId => _saasId;

  dynamic get accCode => _accCode;

  int? get id => _id;

  dynamic get createdBy => _createdBy;

  String? get createdDate => _createdDate;

  String? get updatedBy => _updatedBy;

  dynamic get updatedDate => _updatedDate;

  String? get resultDesc => _resultDesc;

  num? get planTimeFlag => _planTimeFlag;

  num? get resultMode => _resultMode;

  String? audioId;

  String? photoIds;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['elderName'] = _elderName;
    map['bedNo'] = _bedNo;
    map['expenseItem'] = _expenseItem;
    map['executor'] = _executor;
    map['nurseLevelId'] = _nurseLevelId;
    map['nurseLevel'] = _nurseLevel;
    map['executeStatus'] = _executeStatus;
    map['changeExecutorId'] = _changeExecutorId;
    map['delayTime'] = _delayTime;
    map['customerElderId'] = _customerElderId;
    map['serviceAreaId'] = _serviceAreaId;
    map['bedId'] = _bedId;
    map['expenseItemId'] = _expenseItemId;
    map['property'] = _property;
    map['planStartTime'] = _planStartTime;
    map['planEndTime'] = _planEndTime;
    map['planExecuteBy'] = _planExecuteBy;
    map['fee'] = _fee;
    map['executorId'] = _executorId;
    map['status'] = _status;
    map['result'] = _result;
    map['remark'] = _remark;
    map['finishTime'] = _finishTime;
    map['deleteStatus'] = _deleteStatus;
    map['branchId'] = _branchId;
    map['cityId'] = _cityId;
    map['tenantId'] = _tenantId;
    map['saasId'] = _saasId;
    map['accCode'] = _accCode;
    map['id'] = _id;
    map['createdBy'] = _createdBy;
    map['createdDate'] = _createdDate;
    map['updatedBy'] = _updatedBy;
    map['updatedDate'] = _updatedDate;
    map['resultDesc'] = _resultDesc;
    map['planTimeFlag'] = _planTimeFlag;
    map['expenseTypeName'] = expenseTypeName;
    map['resultMode'] = resultMode;
    map['audioId'] = audioId;
    map['photoIds'] = photoIds;
    map['itemDetail'] = itemDetail;
    map['itemImg'] = itemImg;
    return map;
  }

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is ServiceExecuteListData &&
          runtimeType == other.runtimeType &&
          _id == other._id;

  @override
  int get hashCode => _id.hashCode;

  List<ResultBizItem> get bizParams {
    var list = jsonDecode(result??"");
    if (list != null) {
      return (list as List).map((e) => ResultBizItem.fromMap(e)).toList();
    } else {
      return [];
    }
  }
}

class ResultBizItem {
  dynamic value;
  dynamic rangeTo;
  dynamic subItem;
  dynamic property;
  dynamic rangeFrom;

  ResultBizItem(
      {this.value, this.rangeTo, this.subItem, this.property, this.rangeFrom});

  Map<String, dynamic> toMap() {
    return {
      'value': this.value,
      'rangeTo': this.rangeTo,
      'subItem': this.subItem,
      'property': this.property,
      'rangeFrom': this.rangeFrom,
    };
  }

  factory ResultBizItem.fromMap(Map<String, dynamic> map) {
    return ResultBizItem(
      value: map['value'],
      rangeTo: map['rangeTo'],
      subItem: map['subItem'],
      property: map['property'],
      rangeFrom: map['rangeFrom'],
    );
  }
}
